home *** CD-ROM | disk | FTP | other *** search
/ The Programmer Disk / The Programmer Disk (Microforum).iso / xpro / qb2 / pro16 / bshow.bas < prev    next >
Encoding:
BASIC Source File  |  1992-02-06  |  6.2 KB  |  144 lines

  1. ' BShow.Bas
  2. ' Portions Copyright 1987-1990 Microsoft Corp.
  3. DEFINT A-Z
  4. SUB ButtonShow (handle)
  5.  
  6. button = FindButton(handle)
  7. windo = WindowCurrent
  8.  
  9. ' =======================================================================
  10. ' If valid, show the button based on button type and button state
  11. ' =======================================================================
  12.  
  13. IF button > 0 THEN
  14.   LOCATE GloWindow(windo).row1 + GloButton(button).row1 - 1, _
  15.          GloWindow(windo).col1 + GloButton(button).col1 - 1
  16.  
  17.   MouseHide
  18.   SELECT CASE GloButton(button).buttonType
  19.       CASE 1
  20.           SELECT CASE GloButton(button).state
  21.               CASE 1
  22.                   COLOR GloWindow(windo).textFore, _
  23.                         GloWindow(windo).textBack
  24.                   PRINT "< " + RTRIM$(GloButton(button).text$) + " >";
  25.               CASE 2
  26.                   COLOR GloWindow(windo).highlight, _
  27.                         GloWindow(windo).textBack
  28.                   PRINT "<";
  29.                   COLOR GloWindow(windo).textFore, _
  30.                         GloWindow(windo).textBack
  31.                   PRINT " "; RTRIM$(GloButton(button).text$); " ";
  32.                   COLOR GloWindow(windo).highlight, _
  33.                         GloWindow(windo).textBack
  34.                   PRINT ">";
  35.               CASE 3
  36.                   COLOR GloWindow(windo).textBack, _
  37.                         GloWindow(windo).textFore
  38.                   PRINT "< " + RTRIM$(GloButton(button).text$) + " >";
  39.           END SELECT
  40.         CASE 2
  41.             SELECT CASE GloButton(button).state
  42.                 CASE 1
  43.                     COLOR GloWindow(windo).textFore, _
  44.                           GloWindow(windo).textBack
  45.                     PRINT "[ ] " + RTRIM$(GloButton(button).text$);
  46.                 CASE 2
  47.                     COLOR GloWindow(windo).textFore, _
  48.                           GloWindow(windo).textBack
  49.                     PRINT "[X] " + RTRIM$(GloButton(button).text$);
  50.             END SELECT
  51.         CASE 3
  52.             SELECT CASE GloButton(button).state
  53.                 CASE 1
  54.                     COLOR GloWindow(windo).textFore, _
  55.                           GloWindow(windo).textBack
  56.                     PRINT "( ) " + RTRIM$(GloButton(button).text$);
  57.                 CASE 2
  58.                     COLOR GloWindow(windo).textFore, _
  59.                           GloWindow(windo).textBack
  60.                     PRINT "() " + RTRIM$(GloButton(button).text$);
  61.             END SELECT
  62.         CASE 4
  63.         CASE 5
  64.             SELECT CASE GloButton(button).state
  65.                 CASE 1, 2
  66.                     bSw = (GloButton(button).state - 1) * 6 + 1
  67.                     Box3d GloWindow(windo).row1 _
  68.                         + GloButton(button).row1 - 1, _
  69.                           GloWindow(windo).col1 _
  70.                         + GloButton(button).col1 - 1, _
  71.                           GloWindow(windo).row1 _
  72.                         + GloButton(button).row1 + 1, _
  73.                           GloWindow(windo).col1 _
  74.                         + GloButton(button).col1 _
  75.                         + LEN(RTRIM$(GloButton(button).text$)) + 2, _
  76.                           GloWindow(windo).highlight, _
  77.                           GloWindow(windo).textBack, _
  78.                           GloWindow(windo).textFore, _
  79.                           MID$("SINGLEDOUBLE", bSw, 6), -1
  80.                     LOCATE GloWindow(windo).row1 _
  81.                           + GloButton(button).row1, _
  82.                            GloWindow(windo).col1 _
  83.                           + GloButton(button).col1 + 1
  84.                     PRINT RTRIM$(GloButton(button).text$);
  85.                 CASE 3
  86.                     bTLc = SCREEN( _
  87.                      GloWindow(windo).row1 + GloButton(button).row1 - 1, _
  88.                      GloWindow(windo).col1 + GloButton(button).col1 - 1)
  89.                     bSw = ((bTLc <> 201) + 1) * 6 + 1
  90.                     Box3d GloWindow(windo).row1 _
  91.                         + GloButton(button).row1 - 1, _
  92.                           GloWindow(windo).col1 _
  93.                         + GloButton(button).col1 - 1, _
  94.                           GloWindow(windo).row1 _
  95.                         + GloButton(button).row1 + 1, _
  96.                           GloWindow(windo).col1 _
  97.                         + GloButton(button).col1 _
  98.                         + LEN(RTRIM$(GloButton(button).text$)) + 2, _
  99.                           GloWindow(windo).textFore, _
  100.                           GloWindow(windo).textBack, _
  101.                           GloWindow(windo).highlight, _
  102.                           MID$("SINGLEDOUBLE", bSw, 6), -1
  103.                     LOCATE GloWindow(windo).row1 _
  104.                           + GloButton(button).row1, _
  105.                            GloWindow(windo).col1 _
  106.                           + GloButton(button).col1 + 1
  107.                     COLOR GloWindow(windo).textFore, _
  108.                           GloWindow(windo).textBack
  109.                     PRINT RTRIM$(GloButton(button).text$);
  110.             END SELECT
  111.         CASE 6
  112.             COLOR 0, 7
  113.             PRINT CHR$(24);
  114.             FOR A = 1 TO _
  115.               GloButton(button).row2 - GloButton(button).row1 - 1
  116.                LOCATE GloWindow(windo).row1 _
  117.                      + GloButton(button).row1 - 1 + A, _
  118.                      GloWindow(windo).col1 + GloButton(button).col1 - 1
  119.                IF A = GloButton(button).state THEN
  120.                  PRINT CHR$(219);
  121.                ELSE
  122.                  PRINT CHR$(176);
  123.                END IF
  124.             NEXT A
  125.             LOCATE GloWindow(windo).row1 _
  126.                   + GloButton(button).row1 - 1 + A, _
  127.                   GloWindow(windo).col1 + GloButton(button).col1 - 1
  128.             PRINT CHR$(25);
  129.         CASE 7
  130.             COLOR 0, 7
  131.             PRINT CHR$(27); STRING$( _
  132.              GloButton(button).col2 - GloButton(button).col1 - 1, 176); 
  133.             PRINT CHR$(26);
  134.             LOCATE GloWindow(windo).row1 + GloButton(button).row1 - 1, _
  135.                   GloWindow(windo).col1 + GloButton(button).col1 - 1 _
  136.                   + GloButton(button).state
  137.             PRINT CHR$(219);
  138.         CASE ELSE
  139.             PRINT "Error in Button Parameter";
  140.   END SELECT
  141.   MouseShow
  142. END IF
  143. END SUB
  144.